using System;
using System.Collections.Generic;
using System.Text;

namespace Axe.Data.Mapping
{
    public enum ConditionOperator { Equals, NotEquals, Like, Less, Greater, LessOrEq, GreaterOrEq };
    public enum ConditionAggregation { And, Or };

    public interface ICondition { };

    public sealed class Condition : ICondition
    {
        string m_Name;
        object m_Value;
        ConditionOperator m_Operator = ConditionOperator.Equals;

        #region public string PropertyName
        public string PropertyName
        {
            get { return m_Name; }
        }
        #endregion

        #region public object Value
        public object Value
        {
            get { return m_Value; }
        }
        #endregion

        #region public ClauseOperator Operator
        public ConditionOperator Operator
        {
            get { return m_Operator; }
        }
        #endregion

        public Condition(string name, object value, ConditionOperator op)
        {
            m_Name = name;
            m_Value = value;
            m_Operator = op;
        }
    }

    public sealed class CondAggregation : ICondition
    {
        public ICondition Left { get; set; }
        public ICondition Right { get; set; }
        public ConditionAggregation Aggregation { get; set; }

        public CondAggregation(ICondition left, ICondition right, ConditionAggregation arrg)
        {
            Left = left;
            Right = right;
            Aggregation = arrg;
        }
    }
}
